<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改隐患单据')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-hiddenOrder-edit" th:object="${hiddenOrder}">
            <input name="orderId" th:field="*{orderId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">提交人：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{submitName}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">隐患名称：</label>
                <div class="col-sm-8">
                    <input name="riskId" th:field="*{riskName}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">隐患等级：</label>
                <div class="col-sm-8">
                    <input name="level" th:field="*{level}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">隐患地址：</label>
                <div class="col-sm-8">
                    <input name="hiddenAddr" th:field="*{hiddenAddr}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">文字描述：</label>
                <div class="col-sm-8">
                    <textarea name="textDesc" class="form-control" readonly>[[*{textDesc}]]</textarea>
                </div>
            </div>
            <div class="form-group" th:if="${hiddenOrder.mp3Desc}">
                <label class="col-sm-3 control-label">语音描述：</label>
                <div class="col-sm-8">
                    <audio controls>
                        <source th:src="${'../../../'+hiddenOrder.mp3Desc}" type="audio/ogg">
                        <source th:src="${'../../../'+hiddenOrder.mp3Desc}" type="audio/mpeg">
                    </audio>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">责任人：</label>
                <div class="col-sm-8">
                    <input name="dutyId" th:field="*{dutyName}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上传图片：</label>
                <div class="col-sm-8">
                    <img class="pimg" th:each="item,index : ${#strings.arraySplit(hiddenOrder.manyImgs,'|')}" th:src="${'../../../'+item}" height=50px width=60px />
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">整改时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="demandDate" th:value="${#dates.format(hiddenOrder.demandDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "hidden/hiddenOrder";
        $("#form-hiddenOrder-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-hiddenOrder-edit').serialize());
            }
        }

        $("input[name='demandDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>